package xhwl.insurance.ui.fragment;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.bumptech.glide.Glide;

import xhwl.insurance.R;
import xhwl.insurance.ui.PictureSlideActivity;

/**
 * Created by fuyi on 2017/10/20.
 */

public class PictureSlideFragmentOne extends LauncherBaseFragment implements View.OnClickListener {

    private String mPictureUrl;

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        PictureSlideActivity ac = (PictureSlideActivity)getActivity();
        mPictureUrl = ac.getData();

    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View rooView=inflater.inflate(R.layout.fragment_pictureslide, null);
        ImageView mImageView = (ImageView) rooView.findViewById(R.id.iv_pictureslide_one);
        RelativeLayout mPictureslide= (RelativeLayout) rooView.findViewById(R.id.rl_pictureslide_one);
        Glide.with(getActivity())
                .load(mPictureUrl)
                .error(R.drawable.pic_add)
                .into(mImageView);


        mPictureslide.setOnClickListener(this);
        return rooView;
    }

    @Override
    public void startAnimation() {

    }

    @Override
    public void stopAnimation() {

    }

    @Override
    public void onClick(View view) {
        switch (view.getId()){
            case R.id.rl_pictureslide_one:
                getActivity().finish();
                break;
        }
    }
}
